package com.vtc.session13;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Connection/Close to database, support create database structure
 * @author ngocnv
 *
 */
public class SQLHelper extends SQLiteOpenHelper {

	String strSQL = "CREATE table tblstudent(id integer primary key autoincrement," +
			"name text, addr text, age int);";
	public SQLHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
		
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(strSQL);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		
	}
	
}
